//
// Created by nilyang on 2021/11/25.
//

#ifndef BASIC_FILE_HANDLERS_H
#define BASIC_FILE_HANDLERS_H
#include <cstdio>
#include <iostream>
class FileHandler {
    std::FILE *pf{};
    char* filename;
    char* permits;
public:
    /// 构造函数，使用构造函数重载引用初始化
    explicit FileHandler(const char* name):
            FileHandler(name, "w+")
    {}

    /// 打开文件管理器
    /// \param name ./raw.dat
    /// \param mod "rwx"
    FileHandler(const char *name, const char *mod);
    void Write(const std::string& text);
    void Write(const char * text);
    ~FileHandler();
};
/// file 操作
void func_test_file();

#endif //BASIC_FILE_HANDLERS_H
